<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>高压氧多重耐药患者治疗舱消毒记录单填写-form</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <style>
        .form-container {
            width: 100%;
            padding-top: 20px;
        }

        text-align: center;
        .form-container>h2 {
            margin: 0 auto;
            width: 500px;
        }

        .form-container>.form-wrapper {
            display: -webkit-flex;
            display: flex;
            justify-content: flex-start;
            flex-wrap: wrap;
            padding-top: 20px;
        }

        .form-container>.form-wrapper>div {
            width: 50%;
            margin-top: 10px;
        }

        .form-container>.form-wrapper>div>span {
            vertical-align: middle;
        }

        .form-container>.form-wrapper>div>span:nth-child(1) {
            display: inline-block;
            width: 30%;
            height: 30px;
            font-size: 14px;
            text-align: center;
        }

        .form-container>.form-wrapper>div>input {
            display: inline-block;
            width: 70%;
            height: 25px !important;
            font-size: 14px;
            text-align: center;
            vertical-align: middle;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.3);
        }

        .aui-form-list-wrapper,
        .aui-form-list-info-wrapper {
            display: flex;
            display: -webkit-flex;
            justify-content: flex-start;
            flex-wrap: wrap;
            margin: 10px 0;
        }

        .aui-form-list-wrapper>li,
        .aui-form-list-info-wrapper>li {
            width: 50%;
        }

        .aui-list-item-label {
            width: 60% !important;
        }

        .form-submit {
            width: 100%;
            text-align: center;
            margin-top: 50px;
        }

        .form-submit>button {
            width: 170px;
            height: 50px;
            text-align: center;
            background-color: #0064B0;
            color: #fff;
            padding-bottom: 10px;
            font-size: 20px;
        }
    </style>
</head>

<body>
    <main id="app">
        <div class="form-container" style="text-align:center;">

            <h2>多重耐药菌患消毒记录单</h2>
            <!-- <div class="form-wrapper">
          <div><span>科室：</span><input type="text"></div>
          <div><span>姓名：</span><input type="text"></div>
          <div><span>年龄：</span><input type="text"></div>
          <div><span>住院号：</span><input type="text"></div>
        </div> -->
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list aui-form-list-wrapper">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                科室：
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" placeholder="科室" id="">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                姓名：
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" placeholder="姓名">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                年龄：
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" placeholder="年龄">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                住院号：
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" placeholder="住院号">
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list aui-form-list-info-wrapper">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                日期：
                            </div>
                            <div class="aui-list-item-input" id="F_DisRecordTime" onclick="getDateTime()">
                                {{getDateTime}}
                            </div>
                        </div>
                    </li>

                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                签名：
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" placeholder="签名" id="F_DisRecordSign">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                消毒舱壁：
                            </div>
                            <div class="aui-list-item-input">
                                <select id="F_DisBulkhead">
                                <option  value="1" >✔</option>
                                <option  value="0" >✖</option>
                              </select>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                消毒台面：
                            </div>
                            <div class="aui-list-item-input">
                                <select id="F_DisPlatform">
                                <option  value="1" >✔</option>
                                <option  value="0" >✖</option>
                              </select>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                消毒地面：
                            </div>
                            <div class="aui-list-item-input">
                                <select id="F_DisGround">
                                <option  value="1" >✔</option>
                                <option  value="0" >✖</option>
                              </select>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                空气消毒：
                            </div>
                            <div class="aui-list-item-input">
                                <select id="F_AtmosphereDis">
                                <option  value="1" >✔</option>
                                <option  value="0" >✖</option>
                              </select>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <div class="form-submit">
            <button onclick="Insert_HO_DcnyjhzlcDisinfectionRecord()">提交</button>
        </div>
    </main>
</body>

</html>

<script src="../script/api.js" charset="utf-8"></script>
<script src="../script/vue.js" charset="utf-8"></script>
<script src="../js/ToConfigure.js" charset="utf-8"></script>
<script src="../script/aui-toast.js" charset="utf-8"></script>
<script src="../script/aui-dialog.js" charset="utf-8"></script>
<script type="text/javascript">
    var vm;
    apiready = function() {
        vm = new Vue({
            el: '#app',
            data: {
                getDateTime: '选择日期'
            },
            watch: {
                searchInfo: function() {}
            },
            methods: {

            }
        })
    }

    function getDateTime() {
        api.openPicker({
            type: 'date',
            date: getTime,
            title: '选择开始日期'
        }, function (ret, err) {
            if (ret) {
                vm.getDateTime = '' + ret.year +
                    '-' + ret.month +
                    '-' + ret.day
            }
        });
    }
    //获取年月日
    function getTime() {
        const now = new Date();
        const formattedDate = now.toLocaleDateString('zh-CN', {
            year: 'numeric',
            month: '2-digit',
            day: '2-digit'
        }).replace(/\//g, '-');

        return formattedDate;

    }
    function closewin() {
        api.closeWin({
            name: 'disinfection-record-form'
        });
    }



    //添加多重耐药菌治疗患者
    function Insert_HO_DcnyjhzlcDisinfectionRecord() {
        var JsonStr = GetParameters();
        //获取所属医院IP
        var Url_IP = ToConfigure_IP("Gorgeous");
        api.ajax({
            url: Url_IP + 'EquipmentInspect/HO_DcnyjhzlcDisinfectionRecord/Insert_HO_DcnyjhzlcDisinfectionRecord',
            method: 'post',
            dataType: 'String',
            data: {
                values: {
                    parms: JsonStr
                }
            }
        }, function(ret, err) {
            if (ret == "True") {
                JumpPage();
            } else {
                var toast = new auiToast();
                toast.fail({
                    title: "提交失败",
                    duration: 2000
                });
            }

        });
    }

    //跳转页面
    function JumpPage() {
        var dialog = new auiDialog();
        dialog.alert({
            title: "提示",
            msg: '操作成功，是否跳转多重耐药记录单',
            buttons: ['取消', '确定']
        }, function(ret) {
            if (ret.buttonIndex === 1) {

            } else if (ret.buttonIndex === 2) {
                api.openFrame({ // 打开Frame
                    name: 'disinfection-record-header',
                    url: './disinfection-record-header.html',
                });
            }
        })
    }
    //获取参数添氧舱消毒记录
    function GetParameters() {
        var JsParms = new Object();
        //获取日期
        JsParms.F_DisRecordTime = document.getElementById("F_DisRecordTime").value;
        //消毒舱壁
        JsParms.F_DisBulkhead = document.getElementById("F_DisBulkhead").value;
        //消毒台面
        JsParms.F_DisPlatform = document.getElementById("F_DisPlatform").value;
        //消毒地面
        JsParms.F_DisGround = document.getElementById("F_DisGround").value;
        //空气消毒
        JsParms.F_AtmosphereDis = document.getElementById("F_AtmosphereDis").value;

        //api.getPrefs获取当前登录状态
        api.getPrefs({
            key: 'User_Id'
        }, function(ret, err) {
            //当偏好设置尚未设置或者曾设置后被移除后，返回值(ret.value)均为空。
            var val = ret.value;
            if (val != "") {
                //操作人
                JsParms.CreateName = val;
            } else {
                //未登录
                return "";
            }
        });
        //签名
        JsParms.F_DisRecordSign = document.getElementById("F_DisRecordSign").value;

        return JSON.stringify(JsParms);
    }
</script>
